<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js onmouseover onmouseout event</title>
</head>
<body>

    <div onmouseover="mOver(this)" onmouseout="mOut(this)"
         style="background-color:green;width:120px;height:20px;padding:40px;color:#ffffff;">
        把鼠标移到上面
    </div>

    <script type="text/javascript">
        function mOver(obj) {
            obj.innerHTML = "谢谢"
        }

        function mOut(obj) {
            obj.innerHTML = "把鼠标移到上面"
        }

    </script>

</body>
</html>